import _ from 'lodash';
import { keyValue2ArrObj } from './fun.js';
const KF = { 1: '普客客服', 2: '大客销售', 3: '大客客服' }

let DICT_CRM = {
  KVcharacter: (() => {
    let temp = { 1: '温和', 2: '急躁', 3: '乖戾', 4: '善变', 5: '骂人低素质' };
    return keyValue2ArrObj(KF).map((v, k) => {
      return Object.assign(v, {
        children: keyValue2ArrObj(temp)
      });
    });
  })(),//性格
  KVcsBelong: (() => {
    return keyValue2ArrObj(KF)
  })(),//归属客服
  KVcsTag: (() => {
    let temp = [
      { A: 5, B: 6, C: 1, D: 2, E: 3, F: 4 },
      { A: 1, B: 2, C: 3, D: 4, E: 5, },
      { A: 5, B: 6, C: 1, D: 2, E: 3, }
    ]
    return keyValue2ArrObj(KF).map((v, k) => {
      return Object.assign(v, {
        children: keyValue2ArrObj(_.invert(temp[k])).sort((a, b) => {
          return a.label.charCodeAt(0) - b.label.charCodeAt(0)
        })
      });
    });
  })(),//客服标签
  KVoperationalPreference: (() => {
    let temp = { 1: '打板', 2: '短线', 3: '长线', 4: '波段' };
    return keyValue2ArrObj(KF).map((v, k) => {
      return Object.assign(v, {
        children: keyValue2ArrObj(temp)
      });
    });
  })(),//操作编号
  KVproduct: (() => {
    return keyValue2ArrObj({ 1: '新单', 2: '续费', 3: '复购' })
  })(),//产品组
  KVservicePreferences: (() => {
    let temp = { 1: '社区互动', 2: '视频节目', 3: '帖子文章', 4: '技术指标', 5: '沟通唠嗑' };
    return keyValue2ArrObj(KF).map((v, k) => {
      return Object.assign(v, {
        children: keyValue2ArrObj(temp)
      });
    });
  })(),//服务喜好
};

export { DICT_CRM }